package net.csdra.DongPoShuZiTuShuGuan.controller.video;

import net.csdra.DongPoShuZiTuShuGuan.controller.ControllerBase;
import net.csdra.DongPoShuZiTuShuGuan.domain.Video;
import net.csdra.DongPoShuZiTuShuGuan.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by add on 2018/1/16.
 */
@RestController
@RequestMapping("/api/video")
public class VideoController extends ControllerBase {
    @Autowired
    VideoService videoService;

    @RequestMapping("/getVideo")
    public Video getVideo() {
        return videoService.getVideo();
    }

    @RequestMapping("/getVideoByState")
    public Page<Video> getVideoByState(@RequestBody VideoService.GetVideoByState getVideoByState) {
        return videoService.getVideoByState(getVideoByState);
    }

    @RequestMapping("/getPlayVideo")
    public Video getPlayVideo() {
        return videoService.getPlayVideo();
    }
}
